<script setup>
import {ref,reactive,onBeforeMount} from 'vue'
import getUserById from '../api/getUserById.js';
const props =  defineProps({
    value:String
})
const user = ref({})
onBeforeMount(()=>{
    if (props.value!=null){
        getUserById(props.value).then((res)=>{
            if(res.status == 200)
            {
                user.value = res.data
            }
        })
    }
})
</script>
<template>
    <span>{{ user.userName }}</span>
</template>